﻿<!DOCTYPE html>
<html lang="en">
<nav th:replace="shop/include::shopHeader"></nav>

<body class="shopping_cart_page">
   <nav th:replace="shop/include::shopTop"></nav>
  
  <!-- Main Container -->
  <section class="main-container col1-layout">
    <div class="main container">
      <div class="col-main">
        <div class="cart">
          <div class="page-content page-order"><div class="page-title">
            <h2>微信支付</h2>
          </div>
            <div class="order-detail-content">
              <div class="table-responsive">
              	<img th:src="${'/files/'+path}"/>
              </div>
              <div class="cart_navigation"> 
              	<a class="continue-btn" href="/shop/home"><i class="fa fa-arrow-left"> </i>&nbsp; 返回继续购物</a> 
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
   <!-- Footer -->
  <nav th:replace="shop/include::shopFooter"></nav>
<!-- End Footer --> 
<!-- JS --> 
<!-- jquery js --> 
<script type="text/javascript" src="/shop/js/jquery.min.js"></script> 
<!-- bootstrap js --> 
<script type="text/javascript" src="/shop/js/bootstrap.min.js"></script> 
<!-- owl.carousel.min js --> 
<script type="text/javascript" src="/shop/js/owl.carousel.min.js"></script> 
<!-- bxslider js --> 
<script type="text/javascript" src="/shop/js/jquery.bxslider.js"></script> 
<!-- megamenu js --> 
<script type="text/javascript" src="/shop/js/megamenu.js"></script> 
<script type="text/javascript">
  /* <![CDATA[ */   
  var mega_menu = '0';
  /* ]]> */
</script> 
<!-- jquery.mobile-menu js --> 
<script type="text/javascript" src="/shop/js/mobile-menu.js"></script>
<!--jquery-ui.min js --> 
<script type="text/javascript" src="/shop/js/jquery-ui.js"></script> 
<!-- main js --> 
<script type="text/javascript" src="/shop/js/main.js"></script> 
<script type="text/javascript" src="/js/plugins/layer/layer.js"></script>
<script type="text/javascript" th:inline="javascript" >
var orderId = [[${orderId}]];
function loadShoppingCartNum(){
	$.ajax({
		type : "GET",
		url : "/shop/shopping_cart/total_number",
		sync:false,
		data : {},// 你的formid
		contentType:"application/json",
        dataType : "json",
		success : function(r) {
			if (r.code == 0) {
				$("#shoppingCartNum").html("共"+r.msg+"件商品");
			} else {
				layer.msg(r.msg);
			}
		}
	});
}
loadShoppingCartNum();
function checkOrderStatus(){
	var repeat = 200;  // 限制执行次数为200次  
    var timer = setInterval(function() {      
        if (repeat == 0) {  
            clearInterval(timer);  
            //处理页面提示信息
        } else {  
            //Ajax后台轮询 查询订单状态  
            $.ajax({  
                url: "/shop/order/detail/"+orderId,  
                type: "GET",  
                data: {},  
                success: function(r) {  
                    if(r.order.payStatus == 1){  
                        clearInterval(timer);  
                        window.location.href = "/shop/order/list";  
                    }  
                }  
            });  
            repeat--;  
        }  
    }, 3000);//3秒执行一次 总共200次 10分钟 
}
checkOrderStatus();
</script>

 
</body>
</html>
